import React from 'react'

import { Routes, Route } from 'react-router-dom'

import LoginPage from './pages/LoginPage'
import MainPage from './pages/MainPage'
import NeedAuth from './components/needauth/NeedAuth'



import RegisterPage from './pages/RegisterPage.js'
import AccountRecord from './components/account/AccountRecord.js'
import NoAuth from './components/needauth/NoAuth.js'
import NeedRole from './components/needauth/NeedRole.js'
import PasswordEdit from './components/account/PasswordEdit'
import AvaterEdit from './components/account/AvaterEdit.js'
// import DataCleanProp from './components/dataworks_propsetup/DataCleanProp'
import HalfHourCombineProp from './components/dataworks_propsetup/HalfHourCombineProp'
import SpikeRemoveProp from './components/dataworks_propsetup/SpikeRemoveProp'
import TxtCombineProp from './components/dataworks_propsetup/TxtCombineProp'
import MileageCombineProp from './components/dataworks_propsetup/MileageCombineProp'
import PublicProps from './components/dataworks_propsetup/PublicProps'
import VersionHistory from './components/account/VersionHistory.js'
import VersionTimeLine from './components/account/VersionTimeLine.js'
import DataMileageCheckProp from './components/dataworks_propsetup/DataMileageCheckProp.js'
import DataPredictProp from './components/dataworks_propsetup/DataPredictProp.js'
import DataConvertcsviProp from './components/dataworks_propsetup/DataConvertcsviProp.js'

import DataCleanSaveProp from './components/dataworks_propsetup/DataCleanSaveProp.js'
import DataLinearConvertProp from './components/dataworks_propsetup/DataLinearConvertProp.js'
import UserHalfHourCalProp from './components/dataworks_propsetup/UserHalfHourCalProp.js'
import DataUnifyProp from './components/dataworks_propsetup/DataUnifyProp.js'
import UserMileageCalProp from './components/dataworks_propsetup/UserMileageCalProp.js'

import DBCMessageTransferProp from './components/dataworks_propsetup/DBCMessageTransferProp.js'
import DataLSTMPredictProp from './components/dataworks_propsetup/DataLSTMPredictProp.js'


const App = () => {
 
  return (
    <Routes>
      <Route path="/" element={<LoginPage />}>
      </Route >
    
 {/* 可以嵌套路由，当访问main/allgoods就会显示allgoodspage组件 */}
      <Route path="/dataworks/main" element={<NeedAuth><MainPage/></NeedAuth>}>
        <Route path="tmpublicprops" element={<NeedRole><PublicProps/></NeedRole>}></Route>
        {/* <Route path="lmdataclean" element={<NeedAuth><DataCleanProp/></NeedAuth>}></Route> */}
        <Route path="lmdatasaveclean" element={<NeedAuth><DataCleanSaveProp/></NeedAuth>}></Route>
        <Route path="lmspikeremove" element={<NeedAuth><SpikeRemoveProp/></NeedAuth>}></Route>
        <Route path="lmhalfhourcombine" element={<NeedAuth><HalfHourCombineProp/></NeedAuth>}></Route>
        <Route path="lmtxtcombine" element={<NeedAuth><TxtCombineProp/></NeedAuth>}></Route>
        <Route path="lmmileagecombine" element={<NeedAuth><MileageCombineProp/></NeedAuth>}></Route>
        <Route path="lmmileagecheck" element={<NeedAuth><DataMileageCheckProp/></NeedAuth>}></Route>
        <Route path="lmsdatapredict" element={<NeedAuth><DataPredictProp/></NeedAuth>}></Route>
        <Route path="lmsdataconvert" element={<NeedAuth><DataConvertcsviProp/></NeedAuth>}></Route>


        <Route path="dbctransfer" element={<NeedAuth><DBCMessageTransferProp/></NeedAuth>}></Route>
        <Route path="datalstmpredict" element={<NeedAuth><DataLSTMPredictProp/></NeedAuth>}></Route>

        <Route path="halfhourcal" element={<NeedAuth><UserHalfHourCalProp/></NeedAuth>}></Route>
        <Route path="mileagecal" element={<NeedAuth><UserMileageCalProp/></NeedAuth>}></Route>
        <Route path="cleantopredict" element={<NeedAuth><DataUnifyProp/></NeedAuth>}></Route>

        <Route path="linearconvertprops" element={<NeedAuth><DataLinearConvertProp/></NeedAuth>}></Route>
        <Route path="passwordedit" element={<NeedAuth><PasswordEdit/></NeedAuth>}></Route>
        <Route path="avateredit" element={<NeedAuth><AvaterEdit/></NeedAuth>}></Route>
        <Route path="versionhistory" element={<NeedRole><VersionHistory /></NeedRole>}></Route>
        <Route path="versiontimeline" element={<NeedAuth><VersionTimeLine /></NeedAuth>}></Route>
        <Route path="accountsetup" element={ <NeedRole><AccountRecord/></NeedRole>}></Route>
        <Route path="noauth" element={<NoAuth />}></Route >
      </Route >

      <Route path="/dataworks/register" element={<RegisterPage />}>
      </Route >

     
    </Routes>

  )
}

export default App


